package com.hmc.test.cloneableTest.deepClone;

public class Student implements Cloneable {
    private String name;
    private String sex;
    private Student student;

    public Student(String name, String sex, Student student) {
        this.name = name;
        this.sex = sex;
        this.student = student;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    @Override
    protected Student clone() throws CloneNotSupportedException {
        return (Student)super.clone();
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", birthday='" + student + '\'' +
                '}';
    }
}
